import Taro, { Component } from '@tarojs/taro'
import { View,Image,Text } from '@tarojs/components'

import logo_png from '../../assets/imgs/logo.png'
import avatar_jpg from '../../assets/imgs/avatar.jpg'

import './index.scss'
import {connect} from "@tarojs/redux";


class IndexHeader extends Component {

    render() {
        return (
            <View className='index-header' style={this.props.ids.length === 0 ? "padding: 32PX 0;":""}>
                <Image className='logo' src={logo_png} />
                <View>
                    <Text className='slogan'>瑞金二路 \n</Text>
                    <Text className='slogan-tiny'>淮海755党群服务站 \n 午间课程</Text>
                </View>
                <View className='header-right'>
                    <Image className='avatar' src={avatar_jpg} />
                </View>
            </View>
        )
    }
}

const mapStateToProps = ({courseList}) => {
    return {
        ids: courseList.ids
    }
}

const mapDispatchToProps = () => {
    return {}
}

export default connect(mapStateToProps, mapDispatchToProps)(IndexHeader)
